From: Florian Müllner Date: Thu, 18 Jan 2024 17:15:19 +0000 (+0100) Subject: windowManager: Fix effects of transient wayland windows X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~2^2~129 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=11e9fbf264f81851878c4978130aae420ff8b731;p=gnome-shell.git windowManager: Fix effects of transient wayland windows On wayland, transient windows don't use the DIALOG window type, so any effects that special-case dialogs currently pick the wrong animation. Fix that with an "animation window type" that is used instead of the real type. Part-of: --- diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 6af225f14..7603a8ed0 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -1124,6 +1124,21 @@ export class WindowManager { this._allowedKeybindings[name] = modes; } + _getAnimationWindowType(actor) { + const {metaWindow: window} = actor; + const {windowType} = window; + + if (windowType !== Meta.WindowType.NORMAL || + window.get_client_type() === Meta.WindowClientType.X11) + return windowType; + + // wayland doesn't use the DIALOG type, but for + // animations we want transients to behave like ones + return window.get_transient_for() != null + ? Meta.WindowType.DIALOG + : windowType; + } + _shouldAnimate() { const overviewOpen = Main.overview.visible && !Main.overview.closing; return !(overviewOpen || this._workspaceAnimation.gestureActive); @@ -1139,7 +1154,7 @@ export class WindowManager { if (!actor.get_texture()) return false; - let type = actor.meta_window.get_window_type(); + const type = this._getAnimationWindowType(actor); return types.includes(type); } @@ -1487,7 +1502,7 @@ export class WindowManager { return; } - switch (actor._windowType) { + switch (this._getAnimationWindowType(actor)) { case Meta.WindowType.NORMAL: actor.set_pivot_point(0.5, 1.0); actor.scale_x = 0.01; @@ -1563,7 +1578,7 @@ export class WindowManager { return; } - switch (actor.meta_window.window_type) { + switch (this._getAnimationWindowType(actor)) { case Meta.WindowType.NORMAL: actor.set_pivot_point(0.5, 0.5); this._destroying.add(actor);